package PolymorphismBlogDemo.UpperTransferFlaut;

import sun.corba.BridgePermission;

public class UTF {
    public static void main(String[] args) {
        Animal bird = new Bird();
        Animal fish = new Fish();
        bird.eat();
        fish.eat();
        //bird.fly();
        //fish.swim();
    }
}
class Animal {
    public void eat () {
        System.out.println("吃东西");
    }
}
class Bird extends Animal{
    @Override
    public void eat() {
        System.out.println("吃鸟粮");
    }
    public void fly() {
        System.out.println("正在飞");
    }
}
class Fish extends Animal {
    @Override
    public void eat() {
        System.out.println("吃鱼粮");
    }
    public void swim() {
        System.out.println("正在游");
    }
}

